from db import db

class Certification(db.Model):
    __tablename__="certification"
    id = db.Column(db.Integer, primary_key=True, autoincrement=True)
    username = db.Column(db.String(255), nullable=False)
    hospital = db.Column(db.String(255), nullable=False)
    proof = db.Column(db.String(255), nullable=False)
    status = db.Column(db.Integer, nullable=False)

    def __init__(self,username,hospital,proof,status=0):
        self.username = username
        self.hospital = hospital
        self.proof = proof
        self.status = status

    def to_dict(self):
        return {
            'id': self.id,
            'username': self.username,
            'hospital': self.hospital,
            'proof': self.proof,
            'status': self.status
        }